<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        html,body {
            height: 100%;
            overflow: hidden;
        }
        #wrap {
            width: 40px;
            height: 300px;
            border: 1px solid;
            margin: auto;
            overflow: hidden;
        }
        #wrap > .inner {
            height: 600px;
            background-image: repeating-linear-gradient(135deg,black 0px,black 10px,white 10px, white 20px);
            /*transition: 5s;*/
        }
        /*#wrap:hover .inner {*/
        /*    margin-top: -300px;*/
        /*}*/
    </style>
</head>
<body>
    <div id="wrap">
        <div class="inner"></div>
    </div>
</body>
<script>
    var inner = document.querySelector('#wrap > .inner')
    var flag = 0
    setInterval(function () {
        flag++
        if(flag === 300) {
            flag = 0
        }
        inner.style.marginTop = -flag+'px'
    }, 1000/60)
</script>
</html>
